// license-header java merge-point
/**
 * This is only generated once! It will never be overwritten.
 * You can (and have to!) safely modify it by hand.
 */
package org.tinaelle.server.domain;
/**
 * @see org.tinaelle.server.domain.AdTree
 */
public class AdTreeDaoImpl
    extends org.tinaelle.server.domain.AdTreeDaoBase
{
    /**
     * @see org.tinaelle.server.domain.AdTreeDao#toAdTreeDTO(org.tinaelle.server.domain.AdTree)
     */
    public org.tinaelle.common.dto.AdTreeDTO toAdTreeDTO(final org.tinaelle.server.domain.AdTree entity)
    {
        return super.toAdTreeDTO(entity);
    }

    /**
     * Retrieves the entity object that is associated with the specified value object
     * from the object store. If no such entity object exists in the object store,
     * a new, blank entity is created
     */
    private org.tinaelle.server.domain.AdTree loadAdTreeFromAdTreeDTO(org.tinaelle.common.dto.AdTreeDTO adTreeDTO)
    {
        org.tinaelle.server.domain.AdTree adTree = this.load(adTreeDTO.getAdTreeId());
        if (adTree == null)
        {
            adTree = org.tinaelle.server.domain.AdTree.Factory.newInstance();
        }
        return adTree;
    }

    
    /**
     * @see org.tinaelle.server.domain.AdTreeDao#adTreeDTOToEntity(org.tinaelle.common.dto.AdTreeDTO)
     */
    public org.tinaelle.server.domain.AdTree adTreeDTOToEntity(org.tinaelle.common.dto.AdTreeDTO adTreeDTO)
    {
        org.tinaelle.server.domain.AdTree entity = this.loadAdTreeFromAdTreeDTO(adTreeDTO);
        this.adTreeDTOToEntity(adTreeDTO, entity, true);
        return entity;
    }
}